package com.bawei.system.remote.api;

import com.bawei.common.core.constant.SecurityConstants;
import com.bawei.common.core.constant.ServiceNameConstants;
import com.bawei.common.core.domain.R;

import com.bawei.es.domain.*;
import com.bawei.system.remote.factory.RemoteEsDocsFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Es文档操作公共服务接口
 *
 * @author bawei
 */
@FeignClient(contextId = "remoteEsDocsService",
        value = ServiceNameConstants.ES_SERVICE,
        fallbackFactory = RemoteEsDocsFallbackFactory.class)
public interface RemoteEsDocsService
{


    @ApiOperation("文档添加")
    @PostMapping("/insertDocument")
    public R insertDocument(@RequestBody DocumentReq documentReq);

    @ApiOperation("索引查询")
    @GetMapping("/isExists/{indexName}")
    public R isExists(@PathVariable("indexName") String indexName);

    @ApiOperation("文档删除")
    @PostMapping("/deleteDocument")
    public R deleteDocument(@RequestBody BulkDeleteDocs documentId);

    @ApiOperation("文档批量添加")
    @PostMapping("/bulkDocument")
    public R bulkDocument( @RequestBody DocumentReq documentReq);
    @ApiOperation("文档修改")
    @PostMapping("/updateDocument")
    public R updateDocument(@RequestBody DocumentReq documentReq);

    @ApiOperation("文档查询")
    @PostMapping("/getDocument")
    public R<EsDocsQuery> docsQuery(@RequestBody DocsQueryReq docsQueryReq);

}
